package com.wl2o2o.lanqiao.xzfourteen;

import java.util.Scanner;

/** 
* @author : WLei224
* @date ：2023年1月12日 下午1:34:34 
* mag:    aab
* letter: aa   YES
*/
public class Magazine {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String mag = sc.next();
		String letter = sc.next();
		int length1 = mag.length();
		int length2 = letter.length();
		int count = 0; 
		int[] arr = new int[length1];
		char le = 'a';
		//特殊情况
		if(length1 < length2) {
			System.out.println("NO");
		}
		for(int j = 0; j < length1; j++) {
			arr[j] = mag.charAt(j);
			le = letter.charAt(j);
		}
		
		for(int i = 0; i < length2; i++) {
			if( le == arr[i]) {
				count++;
				
			}
		}
			
			
		
		
		if(count == length2) {
			System.out.println("YES");
			//return;
		}
		sc.close();
	}

}
